<template>
	<view>
		<table>
			<tr>
				<td>会员标签</td>
				<td><input type="text" style="background-color: antiquewhite;" v-model="HuiYuanBqi"></td>
			</tr>
			<tr>
				<td>排序</td>
				<td><input type="text" style="background-color: antiquewhite;" v-model="PaiXu"></td>
			</tr>
			<tr>
				<td>会员数量</td>
				<td><input type="text" style="background-color: antiquewhite;" v-model="HuiYuanNum"></td>
			</tr>
			<tr>
				<td>备注</td>
				<td><input type="text" style="background-color: antiquewhite;" v-model="BeiZhu"></td>
			</tr>
			<button type="submit" @click="add()">保存添加</button>
		</table>
	</view>

</template>

<script>
	export default {
		data() {
			return {
				HuiYuanBqi:"",
				PaiXu     :"",
				HuiYuanNum:"",
				BeiZhu    :"",
			}
		},
		methods: {
			add(){
				uni.request({
					url: 'http://127.0.0.1:8080/add', //仅为示例，并非真实接口地址。
					data: {
						HuiYuanBqi:this.HuiYuanBqi,
						PaiXu:this.PaiXu,
						HuiYuanNum:this.HuiYuanNum,
						BeiZhu:this.BeiZhu,
					},
					method: "POST",
					header: {
						'content-type': 'application/x-www-form-urlencoded' //自定义请求头信息
					},
					success: (res) => {
						console.log(res.data)
						if (res.data.Cre==200) {
							alert("添加成功")
							uni.navigateTo({
								url:"/pages/index/index"
							})
						}else{
							alert("添加失败")
						}
					}
				});
			},
		}
	}
</script>

<style>

</style>
